<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>示例10</title>
    <script>
        class StaticClass {
            static count = 1; // 静态属性 
            static incrementAndGet() { // 静态方法 
                StaticClass.count++;
                return StaticClass.count;
            }
        }
        console.log(StaticClass.count); // 1 
        console.log(StaticClass.incrementAndGet()); // 2 
        console.log(StaticClass.count); // 2 
    </script>
</head>

<body></body>

</html>